<?php
require_once('auth.php');
?>
<!DOCTYPE html>
<html>
    <link type="text/css" rel="stylesheet" href="giftgiving.css"/>
    <!-- Uncomment the line below to include javascript in your webpage -->
    <!--<script type="text/javascript" src="giftgiving.js"/>-->
    <style type="text/css">
<!--
.STYLE1 {
	font-size: 18px;
	font-weight: bold;
}
.STYLE2 {font-size: 16px}
-->
    </style>
    <head>
        <title>Floral Home</title>
    </head>
    <body>
        <div id="gift-view-id">
            <!-------  Side bars  ----------------------------------------------------------->
			<div id="gift-navpane-id" class="gift-navpane">
    			<div id="gift-pets-id" class="gift-types">
                    <a href="cus_home.php" class="STYLE1">Home</a>				    </div>
				<div id="gift-pets-id" class="gift-types">
                    <a href="cus_profile.php" class="STYLE1">My Profile</a>			</div>
				<div id="gift-pets-id" class="gift-types gift-types-selected">
                    <a href="cus_myOrder.php" class="STYLE1">My Order</a>			</div>
				<div id="gift-register-id" class="gift-types">
                    <a href="cus_reg.php" class="STYLE1">Register</a>    			</div>
				
                <div id="gift-register-id" class="gift-types">
					<a href="cus_login.php" class="STYLE1">Logout</a>         		</div>
    		</div>
			<!--------------Main Content----------------------------------------------------->
    		<div id="gift-choosepane-id" class="gift-choosepane">
               <!-- Note the onClick handler for this element -->
              <div id="gift-table" onClick="onGiftClick()">
        	   <table>
        			  <th colspan="8"><span class="STYLE2">My order</span></th>
        			  <?php
							include('cus_getMyorder.php');
							echo "<tr>
								  <td>   </td>
						          <td>OrderDate</td>
								  <td>Receiver Name</td>
								  <td>Receiver Address</td>
								  <td>Receiver PhoneNo</td>
								  <td>Deliver Date</td>
								  <td>Flower Name</td>
								  <td>Quanlity</td>
								  <td>Status</td>
							      </tr>";
							while ($row = mysql_fetch_array($myOrders)){
								echo "<tr>";
								$flowerpicture = getFlowerPicture($row['oid']);
								echo "<td> <img id='Socks' src='".$flowerpicture."'/><</td>";
							    echo "<td>" . $row['orderDate'] . "</td>";
								echo "<td>" . $row['recName'] . "</td>";
								echo "<td>" . $row['recAddress'] . "</td>";
								echo "<td>" . $row['recPhoneNo'] . "</td>";
								echo "<td>" . $row['deliverDate'] . "</td>";
								$flowername = getFlowerName($row['oid']);
								echo "<td>" . $flowername . "</td>";
								$numOfFlower = getnum($row['oid']);
								echo "<td>" . $numOfFlower . "</td>";
								echo "<td>" . $row['status'] . "</td>";
								if ($row['status'] == "Processing"){
								echo "<form action='order_modify.php' method='post'>
										<input type='hidden' name='method' value='modifyOrder'/>
										<td> <input type='hidden' name = 'oid' value='".$row['oid']."'> </td>
										<td> <input type='hidden' name = 'recName' value='".$row['recName']."'> </td>
										<td> <input type='hidden' name = 'recAddress' value='".$row['recAddress']."'> </td>
										<td> <input type='hidden' name = 'recPhoneNo' value='".$row['recPhoneNo']."'> </td>
										<td> <input type='hidden' name = 'deliverDate' value='".$row['deliverDate']."'> </td>
										<td> <input type='hidden' name = 'quantity' value='".$numOfFlower."'> </td>
										<td> <input type='submit' value='Modify'></td>
									  </form>";
							    }
								echo "</tr>";
						   }
					  ?>
                  </form>
        		</table>

              </div>
			  <div class="footer-container">
            <div class="left">
                <p>Any questions? Let us help you.  Call us: <strong>+65 9861 5555</strong>   &copy; Copyright Flowers Singapore</p>
            </div>
        </div>
    		</div>
        </div>
	</body>
<ml>